home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
oath.lha
/
oath
/
test
/
toks0.cc
< prev
next >
Wrap
C/C++ Source or Header
|
1991-08-29
|
3KB
|
104 lines
#include "../src/ensure.cc"
#include "../src/typeRegisterP.cc"
#include "../src/exportP.cc"
#include "../src/oathCore.cc"
#include "../src/obj.cc"
#include "../src/token.cc"
#include "../src/character.cc"
#include "../src/bag.cc"
#include "../src/queue.cc"
#include "../src/seq.cc"
#include "../src/lifoQueue.cc"
#include "../src/slNodeP.cc"
#include "../src/pdlQueue.cc"
#include "../src/fifoQueue.cc"
#include "../src/deq.cc"
#include "../src/list.cc"
#include "../src/dlNodeP.cc"
#include "../src/dlList.cc"
#include "../src/string.cc"
#include "../src/dlcNodeP.cc"
#include "../src/minString.cc"
#include "../src/table.cc"
#include "../src/stringTable.cc"
//***************************************************************************
main()
{characterA R = characterA::make('r');
characterA S = characterA::make('s');
characterA T = characterA::make('t');
characterA L = characterA::make('l');
characterA N = characterA::make('n');
characterA E = characterA::make('e');
characterA A = characterA::make('a');
stringA Star = minStringA::make() << T << A << R;
stringA Star2 = minStringA::make() << T << A << R;
stringA Sstar = minStringA::make() << S << Star;
stringA Sstare = minStringA::make() << S << Star << E;
cout << Star.am() << "\t(" << Star.hash() << ")" << endl;
cout << Star2.am() << "\t(" << Star2.hash() << ")" << endl;
cout << Sstar.am() << "\t(" << Sstar.hash() << ")" << endl;
cout << Sstare.am() << "\t(" << Sstare.hash() << ")" << endl;
if(Star == Star2)
cout << "Star == Star2" << endl;
if(Star != Sstar)
cout << "Star != Sstar" << endl;
cout << "Begin forming tokens:" << endl;
stringTokenA Ttar = stringTokenA::make(Star);
stringTokenA Ttar2 = stringTokenA::make(Star2);
stringTokenA Tstar = stringTokenA::make(Sstar);
stringTokenA Tstare = stringTokenA::make(Sstare);
if(Ttar == Ttar2)
cout << "Ttar == Ttar2" << endl;
if(Ttar == Tstar)
cout << "Oops: Ttar == Tstar" << endl;
stringTableA Table = stringTableA::make(255);
Table.insert(Ttar, Star);
Table.insert(Tstar, Sstar);
Table.insert(Tstare, Sstare);
cout << "Table formed." << endl;
if(Table.contains(Ttar)) cout << "Table has member Ttar." << endl;
stringA Atar = stringA::isa(Table.assoc(Ttar));
if(!!Atar) cout << "Atar = " << Atar.am() << endl;
if(Table.contains(Ttar2)) cout << "Table has member Ttar2." << endl;
stringA Atar2 = stringA::isa(Table.assoc(Ttar2));
if(!!Atar2) cout << "Atar2 = " << Atar2.am() << endl;
if(Table.contains(Tstar)) cout << "Table has member Tstar." << endl;
stringA Astar = stringA::isa(Table.assoc(Tstar));
if(!!Astar) cout << "Astar = " << Astar.am() << endl;
if(Table.contains(Tstare)) cout << "Table has member Tstare." << endl;
stringA Astare = stringA::isa(Table.assoc(Tstare));
if(!!Astare) cout << "Astare= " << Astare.am() << endl;
}